﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CanDoo.Core;
using CanDoo.Data;
using CanDoo.Contracts;
using CanDoo.Oil.Core.DTOs;
using CanDoo.Oil.Core.Models;
using CanDoo.Core.Data;

namespace CanDoo.Oil.Core.Contracts
{
    /// <summary>
    /// 业务契约——采购入库单
    /// </summary>
    public interface IInStoreContract : IServiceBaseCore<InStore>, IServiceBase<InStore>
    {
        /// <summary>
        /// 生成新单据号
        /// </summary>
        /// <returns></returns>
        string GetNewCode();

        /// <summary>
        /// 审核通过通知更新库存
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        OperationResult PassStock(InStore entity);

        /// <summary>
        /// 取消审核通知更新库存
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        OperationResult UnPassStock(InStore entity);

        /// <summary>
        /// 采购退货时更新采购单的入库数量
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        OperationResult UpdateNum(long entityId);

        /// <summary>ProductItem
        /// 实体转换为Dto
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        ProductItem EntityChange(InStoreDetail m);

        /// <summary>
        /// PDA通过Code获取采购入库单信息
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        OrderApiDto SendPDAInfo(string Code);

        /// <summary>
        /// PDA上传序列号
        /// </summary>
        /// <param name="orderApiDto"></param>
        /// <returns></returns>
        OperationResult GetPDAData(OrderApiDto orderApiDto);

        ///// <summary>
        ///// 入库时候改变数量
        ///// </summary>
        ///// <param name="inStroe"></param>
        ///// <param name="inBuyBackDetail"></param>
        ///// <returns></returns>
        //OperationResult InToStore(InStore inStroe, IEnumerable<InBuyBackDetail> inBuyBackDetail);

        ///// <summary>
        ///// 出库时改变数量
        ///// </summary>
        ///// <param name="inStroe"></param>
        ///// <param name="inBuyBackDetail"></param>
        ///// <returns></returns>

        //OperationResult OutFromStore(InStore inStroe, IEnumerable<InBuyBackDetail> inBuyBackDetail);
    }
}

